#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>

typedef struct {
    uint16_t x;
    uint16_t y;
    union {
        uint8_t flag;
        struct {
            uint8_t bit0 : 1;
            uint8_t bit1 : 1;
            uint8_t bit2 : 1;
            uint8_t bit3 : 1;
            uint8_t bit4 : 1;
            uint8_t bit5 : 1;
            uint8_t bit6 : 1;
            uint8_t bit7 : 1;
        };
    } flags;
} protocol_t;

void test01() {
    protocol_t prot;
    uint32_t   addr = &prot;
    printf("&prot=%x\n", addr);
    printf("&x=%x, &y=%x\n", &(prot.x), &(prot.y));
}

int main(int arc, char *argv[]) {
    test01();
    return 0;
}